package com.cloud.rou.im.router.handler;

import com.cloud.rou.im.msg.Msg;
import com.cloud.rou.im.protocol.cmd.Cmd;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2019-10-24 17:18
 */
@Slf4j
public class BizHandler extends SimpleChannelInboundHandler<Cmd> {

    private ConnectorService service = new ConnectorService();

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, Cmd msg) throws Exception {
        Msg msg1 = msg.getMsg();
        System.out.println("收到发送人："+msg1.getSenderId()+" ----的消息id："+msg1.getMsgId());
        service.doChatForward(ctx,msg1);
    }
}
